package adapter;

import android.support.annotation.Nullable;
import android.widget.CheckBox;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import bean.QuestionTypeBean;
import student.andlei.com.student.R;

public class QuestionTypeAdapter extends BaseQuickAdapter<QuestionTypeBean,BaseViewHolder>{
    public QuestionTypeAdapter(int layoutResId, @Nullable List<QuestionTypeBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, QuestionTypeBean item) {
        CheckBox checkBox =  helper.getView(R.id.check_xuanze);
        helper.setText(R.id.check_xuanze,item.type_name);
        helper.addOnClickListener(R.id.check_xuanze);
        if(item.isSelect){
            checkBox.setChecked(true);
        }else {
            checkBox.setChecked(false);
        }
    }
}
